﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:Documents="clr-namespace:System.Windows.Documents;assembly=PresentationUI"
                    xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid">


    <Style x:Key="DocumentViewerStyle"
           BasedOn="{x:Null}"
           TargetType="{x:Type DocumentViewer}">
        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}" />
        <Setter Property="Background" Value="White" />
        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
        <Setter Property="ContextMenu" Value="{DynamicResource {ComponentResourceKey ResourceId=PUIDocumentViewerContextMenu, TypeInTargetAssembly={x:Type Documents:PresentationUIStyleResources}}}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type DocumentViewer}">
                    <Border BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            Focusable="False">
                        <Grid Background="{TemplateBinding Background}" KeyboardNavigation.TabNavigation="Local">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <ContentControl Grid.Row="0"
                                            Grid.Column="0"
                                            Focusable="{TemplateBinding Focusable}"
                                            Style="{DynamicResource {ComponentResourceKey ResourceId=PUIDocumentViewerToolBarStyleKey,
                                                                                          TypeInTargetAssembly={x:Type Documents:PresentationUIStyleResources}}}"
                                            TabIndex="0" />
                            <DockPanel Grid.Row="1">
                                <FrameworkElement Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" DockPanel.Dock="Right" />
                                <Rectangle Height="1"
                                           VerticalAlignment="top"
                                           Fill="Silver"
                                           Visibility="Visible" />
                            </DockPanel>
                            <ScrollViewer x:Name="PART_ContentHost"
                                          Grid.Row="1"
                                          Grid.Column="0"
                                          CanContentScroll="true"
                                          Focusable="{TemplateBinding Focusable}"
                                          HorizontalScrollBarVisibility="Auto"
                                          IsTabStop="true"
                                          TabIndex="1" />

                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>